Visual Studio generates an interop assembly containing metadata when you add a reference to a type library. If a primary interop assembly is available, Visual Studio uses the existing assembly before generating a new interop assembly.
To add a reference to a type library in Visual Studio
Install the COM DLL or EXE file on your computer, unless a Windows Setup.exe file performs the installation for you.
Choose Project, Add Reference.
In the Reference Manager, choose COM.
Select the type library from the list, or browse for the .tlb file.
In Solution Explorer, open the shortcut menu for the reference you just added, and then choose Properties.
In the Properties window, make sure that the Embed Interop Types property is set to True. This causes Visual Studio to embed type information for COM types in your executables, eliminating the need to deploy primary interop assemblies with your app.
The menu and dialog box options may vary depending on the version of Visual Studio you're using.
To add a reference to a type library for command-line compilation
Generate an interop assembly as described in How to: Generate Interop Assemblies from Type Libraries.
Importing a Type Library as an Assembly
Exposing COM Components to the .NET Framework
Walkthrough: Embedding Type Information from Microsoft Office Assemblies
Walkthrough: Embedding Types from Managed Assemblies
/link (C# Compiler Options)
/link (Visual Basic)