Depending on the company, they would usually BUY the CODE from you. (IE: Throw the word 'license' out the window, and start talking EXCLUSIVE RIGHTS)
You see, a company doesnt want to be selling the SAME program as someone else does, so in buying it off you, they would take away your right to sell it to anyone else. Actually, they'd take away your right to even put your name next to the copyright symbol, in place of their name. Or at least I would if this was me. Theyd still let you put it in the credits though.
Egs:
Microsoft bought out Connectix VirtualPC. This was basically to do with that if microsoft are the only people selling their Windows OS, then they set their prices.
Corel bought Bryce off Metacreations. Same program exactly, different name next to the (C)
CuriousLabs bought Poser off Metacreations. Now the curiouslabs google description says: "The creator and publisher of Poser, 3D character animation and figure design tool." Even though they didnt do that really...
I'm trying to think of other takeovers.