midl /iid filename
midl /iid "foo_iid.c" filename.idl
The /iid switch specifies the name of the interface identifier file for a COM interface, overriding the default name obtained by adding _I.C to the IDL filename. The /iid switch does not affect RPC interfaces.
If filename does not include an explicit path, the file is written to the current directory or to the directory specified by the /out switch. An explicit path in filename overrides the /out switch specification.
General MIDL Command-line Syntax, /header, /out, /proxy