One of the more common missteps involving intellectual property is the concept of a work made for hire. This concept is defined in the U.S. Copyright Act and there is a lot of case law over the years regarding it.
Many people believe that "if Company A paid for Person B to develop The Thing, then Company A owns The Thing"... like all things lawyer, the answer is "maybe." If Person B was an employee of Company A and it was part of Person's B to develop The Thing, then The thing is a work made for hire.
There is a second concept for work made for hire...
...that is spelled out in the statute, but it requires many other extra hoops for The Thing to qualify as a work made for hire. However, as you can see, not every instance qualifies as a work made for hire. And, if The Thing does not qualify as a work made for hire, then Company A will have paid it, but won't have any rights to it.
So, if you are Company A, you cannot afford to assume that everything is a work made for hire. Make sure that your form employee (and contractor) agreements have a full-blown assignment to the company. Make sure that the assignment is a present (as opposed to future) assignment... but I'll blog on that another day.