You can build the COM interop assembly by running the BuildDLLFromIDL.cmd batch file in the directory, or by manually executing the MIDL and TLBIMP commands.
Requirements
To build the DLL manually, you must have the following tools available in your PATH (e.g., via a Visual Studio Developer Command Prompt):
midl (Microsoft's MIDL Compiler): Part of the Windows SDK; used to produce a Type Library from an .idl file.tlbimp (Microsoft's .NET Framework Type Library to Assembly Converter): Part of the .NET Framework SDK; used to produce a COM interop assembly from a Type Library.peverify (Optional): Part of the .NET Framework SDK; used to verify the generated assembly.
:: Option 1: Run the provided batch file
BuildDLLFromIDL.cmd
:: Option 2: Manual steps
:: 1. Create a COM Type Library (.tlb) from the .idl definition
midl.exe /mktyplib203 ^
/env win32 ^
/tlb ComTypes.tlb ^
ComTypes.idl
:: 2. Convert the type library to a .NET interop types assembly
tlbimp ComTypes.tlb ^
/out:Moq.Tests.ComTypes.dll ^
/namespace:Moq.Tests.ComTypes ^
/keyfile:..\..\Moq.snk ^
/asmversion:4.0.0.0
:: 3. (Optional) Verify the generated assembly
peverify Moq.Tests.ComTypes.dll