How to wrap existing C++ code into a plugin or module

I developed a new asset with a factory that import the asset from a text file.

the code was developed inside a test project, for fear of messing up my current project, and now I need to migrate the code.

I tried looking for making a plugin but no one tells what to do if you already have existing code. Also I’m worried about the UELA license since I’d like to make it open source.