So, I pulled the plug on the managed library and am now cleaning up the fallout.
I am changing the command passing between the two to be just simple strings and the returned data to just be simple binary buffers that can be cast to managed structures.
The CSG library uses flatbuffers, but I don’t think I need to keep that complexity for the data marshalling between the two.