The answer depends on the contract. This is another reason, if not the top reason, to get an agent. The publisher or corporation will do everything in its power to give as little money as possible to the creator and more money to the machine. Your agent will attempt to get as much money to you and her instead.
Now to the answer.
When you write a novel or script, if done correct, they belong to you. In fact, everytime that character sees print or media, you should get paid royalties.
For example, in the shortlived series
Enterprise, the female Vulcan T'Pol was originally suppose to be the famous T'Pau from the episode
Amok Time.
http://en.wikipedia.org/wiki/Amok_TimeBut, if the producers used the character T'Pau and her immense history, they would have to pay her creator and writer, Theodore Sturgeon, royalties every time she appeared in episode.
So they changed her name and background.
This is also the reason Rowling is our first billionaire: character royalties.
Now, the other side.
If you sell the rights to your characters and book to the corporation, you lose all rights to voice objection or future monies. In other words, if you take the big check now, Hollywood can rewrite and change your work into something completely different.
Ask Alan Moore.
And this is why the publisher can commission new authors to continue to write books, with someone else's characters, for the stockholders.
Again, the answer lies with the contract's wording.
Fair warning to you future, and hopeful, millionaires.
Don't let it screw you.
Wolfe