You cannot pass a List<> to unmanaged C++, since it has no access to the CLR and wouldn't know what to do with it.
What you can do is define a structure in C++ that matches the layout of your C# class and pass that to an exported C++ function that expects an array. Depending on how much control you have over the C# and C++ definitions, there are some things you can do to make life easier on yourself:
First, define your C# type with interop in mind:
// In C#:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct Person
{
[MarshalAs(UnmanagedType.LPWStr)] public string FirstName;
[MarshalAs(UnmanagedType.LPWStr)] public string LastName;
public int Age;
}
// In C++
typedef struct tagPerson
{
LPWSTR firstname;
LPWSTR lastname;
LONG age;
} Person;
Second, since C/C++ arrays aren't managed you'll need some other way to define how big it is; the easiest option is pass a second parameter to your C++ function that is the length.
// In C++
extern "C" __declspec( dllexport ) void MyFunction(LONG count, Person[] people);
// In C#
[DllImport("mydll.dll")]
public static extern void MyFunction(
int count,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Person[] people);
Then you can simply call this method in C#; if you already have your populated List<Person> you would do this:
var personsArray = persons.ToArray();
NativeMethods.MyFunction(personsArray.Length, personsArray);