Hey
Vilbjørg,
Cool! You can probably accomplish this with "chugins", a number of which are available in source form here:
The chugin system is primarily designed to create new C++ unit generators, but it can be used to link dynamically with external C/C++ libraries.
All of the chugins on the github site import ugens -- you will want to subclass Object instead, and, depending on how you design the API, either add member functions or static functions to your subclass. Also, none of those chugins interface with external libraries, but that will work, you just need to get the linker settings right when building the chugin.
spencer