Do you mean Visual C++ v5.02 ? (Or may be Borland C++ v5.02). There are no google hits on Microsoft C++ V5.02.
In the case of Visual C++ it is as weaknessforcats stated, when you create a project you need to look for the "static library" project type, then you will create a project that produces a library (.lib)
If you are using the command line then there is a switch to the linker that instructs it to create a library (.lib) rather than an executable, for your version I believe you should be using either the command lines
link32 -lib <arguments>
or
lib32 <arguments>
Since Visual Studio 2005 this has become
lib <arguments>