There are many ways. Read about "interop" on MSDN ..
One way is to open lib as a DLL, and then use pinvoke to call these functions from a C # project. However, this limits the C-style interface.
If your interface is more complex (for example, object-oriented), you can create a C ++ / CLI layer that will reveal the structure of the lib class to your C # program. This means that you will need to create a C ++ managed project (or C ++ / CLI, now called); then create an interface in managed code that will be implemented by calls in C ++ (i.e. your lib).
Another way to do this is to wrap your library using the COM interface. But com is a pain, so I would not ...
Assaf lavie
source share