There are several options for this.
The easiest, as Rob Walker said , is to use C ++ / CLI to create a managed wrapper.
However, there are other options.
You can use SWIG to create C # wrappers for the C ++ API. This works pretty well, but it's a more complicated option. (It’s good if you also want to make other language shells for your C ++ API, however, since you can do C # /. NET, python, Java, etc. with one set of APIs.)
Platform Invoke (P/Invoke) ++ DLL. , C API ++ DLL, .