Assume that in my free time I have developed library X before signing a contract or being employed by company A.I then sign a contract with company A and begin working. It becomes apparent that library X will be incredibly useful and save the company lots of time and money.What is the industry standard practice in this area in terms of bringing this code into the company? Would it be possible to license library X to company A? 
Bringing your previous intellectual property to your employer
licensing;intellectual property
If the library is your work, and you still have rights to it, you are free to sell it to anyone that wants it. If A wants it, and is prepared to pay the asking price for a license, its a valid transaction.Where these can get tricky is where you bring IP you gained working for A and put it into X. Make sure that the contract clearly specifies who owns rights to changes made at the request of A, and other changes made to X, subsequent to the contract (an subsequent to your employment with A). Also come up with rules for when you are allowed to work on X (if in company time, then the work typically belongs to A). Make sure you cover what happens if you and A part company on less than amicable terms. See a lawyer. (Disclaimer, I am not a lawyer)