The article
How Do I Write an Extension in C? gives full details of how to write and compile ZEMAX extensions using the C-compiler in Microsoft Visual Studio 6. Microsoft is now shipping Visual Studio 2005, and this article describes how to configure that compiler. Please see the original article for an explanation of what Extensions are.
Start Visual Studio 2005, and then define a new C++ Win32 project

Enter a name for this project: in this case I used the name VS2005. Then press OK. In the next screen, "Application Settings", declare this to be an empty project, so no files are created.:

Set the project to Release Mode:

In the Solution Explorer, click on the Source Files folder (red box 1 below), then right-mouse-click and choose Add...Add Existing Item. Add the two files hello_world.c and zclient.c. Both can be downloaded from the links at the end of this article:

{Now
if you are using the Jan 22 2007 or earlier release of ZEMAX, you should use the zclient.c which is included at the end of this article, and NOT the version that is distributed with ZEMAX. This new version contains an extra line, specifically for Microsoft Visual Studio 2005:
#pragma warning ( disable : 4996 )
// functions like strcpy are now deprecated for security reasons; this disables the warning
(Each implementation of C and C++ supports some features unique to its host machine or operating system. The #pragma directives offer a way for each compiler to offer machine- and operating system-specific features while retaining overall compatibility with the C and C++ languages. Pragmas are machine- or operating system-specific by definition, and are usually different for every compiler.)
Versions of ZEMAX subsequent to January 22 2007 have this updated zclient.c shipped with them.}
Then, in the Solutions Explorer, click on the top line to select the project itself (red box 2 above), and then click on Project...Properties, or click [Alt]+F7. There are two changes you must make. The first is under the general Configuration Properties, and you should select the Multi-Byte Character Set:

The second change is under the C/C++ settings, and it turns off warnings of portability issues for a 64-bit compilation (we will support 64-bit compilation separately)

Then click on Build...Build Solution and the project should compile normally, without error:
------ Build started: Project: VS2005, Configuration: Release Win32 ------
Compiling...
zclient.c
hello_world.c
Linking...
Generating code
Finished generating code
Embedding manifest...
VS2005 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
That's it! Everything else is the same as in the article
How Do I Write an Extension in C?