Generally speaking there are 3 methods to interoperate between C# and unmanaged (native) C/C++ --
- Use P/Invoke to call functions in a C/C++ DLL. DllImport is used to make the unmanaged function accessible to C# and also provides the information that the interop marshaler will use to call the function and pass data between the managed code and the unmanaged code. This approach is not appropriate for C++ classes. Neither C# or the interop marshaler understand C++ objects or their member functions (except for static functions that do not require a class instance). See https://learn.microsoft.com/en-us/dotnet/framework/interop/marshalling-data-with-platform-invoke
- Use an assembly written in C++/CLI to serve as an intermediary between C# and unmanaged C/C++. The advantage here is that the intermediary assembly can understand C/C++ functions as well as C++ objects and their member functions.
- Use COM. I mention this for completeness but it is most likely not relevant for your circumstances.