Sample showing how to detect the architecture the program has been compiled for.
In that way we could do something like this
#if Is64Bit
[DllImport(@"Resources/HIDAPI/x64/hidapi")]
#else
[DllImport(@"Resources/HIDAPI/x32/hidapi")]
#endif
Sample project demonstrating how to retrieve the architecture the program has been compiled for
C#