In Windows there's a special function on DLLs that is called when the DLL is loaded. The function must have the name "DllMain". When the library is loaded, this function will be called. But this is only for native DLLs.
Anyway, there's a way to do this in .NET. But note that you shouldn't do that... Why you need this? .NET assemblies are different from native assemblies: they can't be injected in the same way you inject a native DLL. Are you sure about what you're doing? In which process you want to inject the DLL?
If you want to run some code the first time anybody calls a static method or property of your class or constructs an instance of your class, give your class a static constructor and do your initialization there.
If you want to inject the DLL into a native process, you should use a native DLL.