which boils down to having a GetInstance() function which returns a pointer to the class you want to export, however I can't think how I can achieve the same thing but make it possible for a C# project to use the class, I can't return a whole C++ class to C#, just functions.
I do need my C# app to create several instances of the class I'm exporting however, so I can't think how to approach this.
Create a manged c++ wrapper class for your native c++ dll.
This will have to be done in a mix mode c++/cli dll.
You can store a pointer to your native class within this managed wrapper.
Then create all the corresponding methods you need from your native class in your managed class and simply relay those calls from your managed class method to the corresponding native classes method via the pointer to the native class: