How can I programmatically tell in C# if an unmanaged DLL file is x86 or x64?
Instead of Assembly.LoadFile, use Assembly.ReflectionOnlyLoadFrom. This will let you work around the "Bad Image Format" exceptions.
Assembly.LoadFile
Assembly.ReflectionOnlyLoadFrom