If you have you Embed Interops Options for SW set to False than you might need to repair the SOLIDWORKS. The issue like this usually means that the COM objects got messed up in the registry so they cannot be matched to the interface. This might happen when you install/reinstall SW products.
If I have this issue repairing of SOLIDWORKS usually helps.
That did not solve my problem unfortunately.
Update on the situation :
I followed the idea that Artem Taturevych proposed. I already knew that the Repair option did not fix my problem. But suddenly I thought about the way of installing Solidworks. We work here with Image installations.
I decided to uninstall the Image installation of Solidworks 2016 SP5 and install a Unique Installation.
Now my code works perfectly with the DLLs as Embed Interop Style set to True.
Maybe in the image installation the DLLs are not registered? That would be my best guest.