I realize this is old and you have probably already found an answer but i will post how i fixed it anyway incase someone else comes across it.
Windows 7 Pro x64
Same error as what you posted above.
Fix: open run (windows key + R) paist the following:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe "C:\Program Files\SolidWorks 2014\SolidWorks\sldworks.tlb"
No need to restart computer....just worked.
Please note where is says Solidworks 2014 change this to the name of the folder where solidworks is installed.
Thanks for posting this
Windows 7 Home Premium x64
Solidworks 2014 sp5
I had difficulty adding the type library to my solution in visual studio 2015 (VB.NET) as shown in the help file:
I got an error message saying that sldworks.tlb was invalid and could not be added.
When I would run the program I was getting the same error as you described
Ben's code worked for me too!
Looks like something wrong with your type libraries registration on a target machine. You may need to repair SolidWorks. Another question what Framework version are you using? Make sure that XP machine has appropriate framework installed and make sure you are using the libraries from appropriate framework: http://help.solidworks.com/2014/English/api/sldworksapiprogguide/Welcome.htm