dllimport of C++ class or member functions

I have C++ function "getPos()" which is exported as dll.

extern "C"{
    extern __declspec (dllexport) void getPos(float *pPos);
}

Then the function is invoked at Unity side using C# script

[DllImport("MyDLLPlugin")]
    private static extern void getPos([In, Out] float[] pPos);

While this works perfectly, I don't know how to import the DLL function(getPos) if the function is a member of some class. Or if we can import the entire class along with its member functions in C#, that'll be great too.

I would appreciate it if someone could suggest a way of importing C++ member functions into C#.

You can't, pretty much.

The way I usually do it is to allow access to instances through an id (be it string or int), which the c++ passes to the c# script on creation (or the c# script passes to c++ to use for creation).