I am writting a plugin for a program, and I want to put my code inside a DLL so I can share the plugin freely without exposing (giving away) my code.
Here is the bas
The best option would be to use a framework for creating extensible applications:
If you want to do it manually, you can use the Assembly.Load*() methods to load an assembly at runtime. You can search the assembly for types that implement a specific interface and then create instances using Activator.CreateInstance. The assemblies can be compiled separately, you just have to reference an assembly that contains the interface shared by application and plugin.
For obfuscation, there are a couple of obfuscation tools available.