A Dynamically Linked Library (DLL) is Microsoft's version of the "shared object" concept (exists in UNIX and other operating systems as well).
A program library is a collection of function and class definitions that are intended to be used by other programs (client programs). Often libraries are #include-ed and compiled with the client code. Such an extension of code with standardized shared code is the case of a statically linked library, because following the compilation phase, the linker connects the object code of the library into the actual executable.
The problem with statically linked libraries is that the source code needs to be provided. The compilation also takes longer, since the utilized library code is re-compiled every time it is used, and the resulting executable file is huge, since it includes the statically linked object code of the library.
To avoid this problem, compiled code of libraries can be provided. Such compiled code is stored in binary files, but is not directly executable (runnable). Instead, it is linked dynamically, i.e. at run time into the executable code.
Microsoft's version of such compiled libraries are called DLLs. When a DLL is compiled, its binary file is "exported", and can be used in client code. The client code still needs to #include the appropriate header file, but does not need the source code (*.cpp). Instead, the output of a DLL compilation process is two files: a library file (.lib) and a dll file (.dll). The .dll file contains the actual compiled library, the .lib is a directory to it (similar to a "table of contents"). These files are normally placed in a standard folder in the system directory and registered with the Registry. If they are not, the library and dll files can be placed in the same folder as the client code (together with the header file) and used directly.
Normally, DLLs are first tested (as a regular class, included in a test project). Once tested, the header definitions can be changed from "TEST" to "BUILD" resulting in a DLL export class (instead of a regular class).
Note: In C++ Builder, to test the DLL, create an ordinary console project tester (has a main() function). Use the "TEST" switch. In order to build the DLL, you need to create a new project, which is a DLL Wizard project (as opposed to console). You need to add the DLL header and source file (using the "+" button), and build it using the "BUILD" switch. The result is a .dll and a .lib file.