To check whether a module is managed code or not, we need to read the PE file header info, the following link is useful discussion about this, including an implementation using VC++.
http://forums.codeguru.com/showthread.php?424454-Check-if-DLL-is-managed-or-not