This is how I managed to do it finally...
First split each interface to separate IDL file
Interface1.idl
Interface Interface2; // forward declaration
#ifndef __Interface1_IDL_FILE_
#define __Interface1_IDL_FILE_
import "AllIDLInterface.idl";
[
object,
uuid(66006A2F-B777-4e2f-A0CA-D5BE00000015),
dual,
nonextensible,
pointer_default(unique)
]
interface Interface1 : IUnknown{
HRESULT getInterface2([out, retval]Interface2** outVal )
};
#endif
Interface2.idl
Interface Interface1;// forward delcarations
#ifndef __Interface2_IDL_FILE_
#define __Interface2_IDL_FILE_
import "AllIDLInterface.idl";
[
object,
uuid(66006A2F-B777-4e2f-A0CA-D5BE00000015),
dual,
nonextensible,
pointer_default(unique)
]
interface Interface2 : IUnknown
{
HRESULT getInterface1([out, retval]Interface1** outVal )
};
#endif
Create another IDL file AllInterface.idl containing import of all interface file
import Interface1.idl
import Interface2.idl
Now the main.idl for which we will be creating TLB files
import AllInterface.idl;
The only draw back here is, we have to compile each IDL file separately, if we want to generated the C++/C header file of interfaces.