As Visual Studio 2005 can do while referencing a registered COM library, you can use the following scripts to automate the creation of an interop :
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\tlbimp.exe"
MyLibrary.dll
/out:Interop.MyLibrary.dll
/namespace:NewRootNameSpace
/keyfile:MyLibrary.snk
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.data.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.xml.dll
/verbose
/asmversion:1.0.0.0
(If necessary, add reference options)
For a recall, the strong named key is created with :
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe" -k MyLibrary.snk
Don’t forget to register the library with regsvr32.exe before executing the first script
WARNING ! For COM library created from VB and using instructions like ReDim, it is useful to add the option : /sysarray to have System.Array declared (for intance : instead of string[] for String() VB parameters).