There is no a way to do it without modifying the DLL file. Such things are
System.Reflection.Emit
and CodeDOM allow to create code during runtime and add it to your current process in the same runtime, but this code should be the whole new assembly or a so called
dynamic method, not the type.
Now, the question probably assumes that the DLL in question is some valid .NET assembly. More exactly, it could be one of the assembly
modules, most likely, just the only main module of some assembly. If so, you can easily (if it does not include some protection) reverse engineer it, add new code in source code and build it again. The excellent open-source tool for that is ILSpy:
http://en.wikipedia.org/wiki/.NET_Reflector[
^] (see other products in this article),
http://www.ilspy.net/[
^].
However, make sure this action is legitimate.
All legal consequences of possible illegal use of the assembly which comes without source code is your sole responsibility. In most domains of legislation such things are legal under certain conditions, but you should be careful about that.
—SA