In 1938 DC comics published the first Action Comics featuring the character Superman, created by Jerry Siegal and Joe Shuster. Siegal and Shuster had previously created the character before taking it to DC whom had a contract written up assigning "exclusives right(s)" to Superman "to have and hold forever" for the sum of $130. Clearly the contractor who wrote this up was in-experienced but the duo signed it and recieved a payment of $10 for each page in the first Action comics.
After this DC comics went forward and registered the rights to Superman in the company's name, claiming that Shuster and Siegal had created the character as "work made for hire". This was far from the case as the two worked from their personal studio in Cleveland and pay their assistants out of their own pocket all the while the big wigs in New York were making a considerable larger amount from the IP.
Tension begame to grow between the creators and publishers as demands for higher pay checks was met with critism of the work being produced. Eventually in 1944 DC wanted to introduce a new younger version of Superman, Superboy. This caused further friction as Siegal had proposed a similar concept that was shot down by DC, although his studio was creating superboy stories Siegal felt as though he wasn't being properly compensated for an idea that took origins from his idea.
Siegal found a friend in a lawyer whilst in the army, once the war was over the two were planning to take action against DC but when an attempt in trying to enlist fellow creator Bob Kane (creator of Batman) resulted in Kane warning the head of DC comics, Jack Liebowitz of their plan giving DC time to prepare legal action.
Siegal and his lawyer filed a suit against DC in April 1947 for the ownership of Superman and Superboy including $5 million in damages due to the characters popularity. Unfortunately the court ruled in favour of DC's ownership of Superman but the creative duo did win on the account of Superboy being made from their original. An offer was made to the two of $100,000 to all right to the characters, the pair agreed but it didn't get any better as most of the money went to pay for the laywer and because they passed on all right to the characters Siegal and Shuster missed out on all future revenues created by anything featuring Superman.
After more lawsuit attempts when the copyright for the character was coming close to expiration it was finally one last shove that drove Jerry Siegal over the dge to try one last time (Joe Shuters had since become blind and in the care of his brother). Once news of that the screenplay writer of SuperMan the movie was recieving $3 million reached Siegal he furiously began typing up all the indignities they had suffered due to DC's strangle hold onto work that the pair had created. Eventually Siegal got to teel his tale which caught the attention of Jerry Robinson (creator of Batman characters, Robin and The Joker, though Bob Kane would never tell you this). Robinson, now a political cartoonist and fromer president of the National Cartoonists Society, vowed that he would take action to help resolve the Superman creators' plight.
Gaining support from the National Cartoonists Society, the Screen Cartoonists Guild and The Writers guild of America, an agreement was reached with Warner (the now owners of DC comics) in which Siegal and Shuster would each recieved a Stipend payment of $20,000 for life and a "created by" credit on all relative material (excluding toys, oddly). With the two finally being paid for the work and success of their character, in 1978 at the premire of Superman: The Movie the pair arrived to view their creation brought to life in a stretch limo.
From the creation of the character it took Siegal and Shuters a total of 27 years to regain the rights to their character, the general mixed that caused all of this was when DC reigstered the character as "Work for Hire". This essentially means that any work created was done as an order by the company there for the company owns the rights to it, not the creators. Whilst what DC had done was sneaky it was still at a time when copyright law was young and a lees understood thing, meaning many companies could take advantage of the various loop holes in a contract and of course the Pair were also in experienced in signing off their work as professionals.
Today the most effective way to avoid this is to throughly read contracts that you're signing and always copyright your work personally that you plan to sell to studios afterwards. If you plan on creating an IP for yourself instead of being commissioned to do so it's always a good idea to watch out for the illusive phrase "Work for Hire".