WideString is compatible with COM BSTR, and so the .net marshaller should be able to use it pretty happily:
[DllImport(@"test.dll")]
private static extern void methodToCall(
[MarshalAs(UnmanagedType.BStr)]
string aFirstParameter,
[MarshalAs(UnmanagedType.BStr)]
ref string aSecondParameter
);
source
share