I have code of mine, developed before joining the company as a co-founder, that I used for the company product (website) but want to retain the copyright and all IP rights to it and to be able to use it in other personal or commercial projects outside of the company. This code does not represent the core functionalities of the product.
How can I do it?
Related: Side projects while being a co-founder and officer of a company One solution would be to license the software to the company. A more in-depth question on this approach is asked here: Licensed software and due diligence: sufficient?
Your best bet is going to be talking with a lawyer that specializes in IP and Copyrights, I'm sure they can help you come up with some sort of contract and help you navigate through the issue.
By definition, any grant of rights that are less than ownership is the grant of a license. Accordingly, you need a license agreement (assuming that the company agrees to have the rights of a licensee rather than ownership).
Please note that although the license agreement need not be long, preparing it is not a do-it-yourself project, in that if you are not familiar with license agreements, it is unlikely that you can draft license provisions properly.
Disclaimer: This information does not constitute legal advice and does not establish an attorney-client relationship.