You should be able to specify the os target in the project settings, e.g. as a compilation parameter. Unfortunately I am not using the project UI of Visual Studio and cannot give you the specifics. However this is not an optical specific development question and you should be able to get help on project settings in the closeby Visual Studio MSDN forum.

There seems to be some confusion here. imapi dlls are built and provided by Microsoft. Vista comes with imapi2 inbox, and download packages are available for both XP and Server 2003. A third party developper (i.e. you) do not have to compile imapi dlls (and actually cannot compile them as one need the source code to do that!). A third party developper may use imapi in his application. For that he will need the appropriate imapi headers in his development system (available from the platform SDK). Also, if he wants to build an application that works also on Windows XP, he has to be careful that the target os for his build environment matches his intend. It could be that the default target os for the development environment you are using is already windows XP, then this is a no-op.

And yes, you do need to install the imapi package on your test systems if using XP and Server 2003, otherwise the dependency you have taken on the component which is not available inbox will fail.

OS of your development system does not matter, as long as it is compatible with your build environment and the platform SDK.