DLLS started because the early versions of Windows were very memory constrained (remember when 8mb RAM was a lot?) and they were a way to share code between different modules of an application. Because they're code-only, they only get loaded into memory once -- all applications that use one are sharing the same memory image. This is also why you can't define global variables in a DLL (memory for shared variables has to come from the calling EXE file). (NOTE: COM DLLs are a different story - we're talking Win16 and Win32 here).
Under .NET, the same rules apply -- Assemblies which are DLLs are shared between Assemblies which are EXEs, or run in an EXE (like ASP.NET pages).
To create a DLL in .NET, you just create a project of type Class Library. You will need to also create a small EXE project to unit-test your DLL, since a DLL can't be called directly in the debugger.
Preventing other people from seeing your code is very difficult in .NET, as anyone can run ILDasm.exe against an assembly and inspect it's contents. There are some obfuscators available now (do a Google search), but I think they're more trouble than they're worth -- You should be able to depend on your products license, which should not permit reverse-engineering. In the future, you will be able to apply Digital Rights Management (DRM) to your assemblies to prevent people from viewing them.
Chip H.
If you want to get the best response to a question, please check out FAQ222-2244 first