The IDL files where using custom build.
In the IDL files properties General -->Tools "custom build tool" was selected.
And in the Custom Build Step
the mild command was given with some options. I had to do the platform specification here ie
midl /amd64 /Oicf /h "CSObjectCache.h" /iid "CSObjectCache_i.c" "CSObjectCache.idl"
Giving the platform switch solved my problem.