Writer owns the copyright forever no matter what. Even if you made smth for hire, you still owns the copyright.
In the US, the copyright on a work made for hire belongs to the employer. The employer is the copyright holder, from the very start, and the employer is considered the author.
I believe this is also true in the EU, but my memory is less certain as regards the EU. If you want to be certain, please ask an EU lawyer.