Разобрался!
#include "stdafx.h"
#include <string.h>
#include <windows.h>
#include <wininet.h>
#include <shlobj.h>
#include <AtlBase.h>
#include <AtlConv.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
HRESULT hr;
IActiveDesktop *pActiveDesktop;
hr=CoInitialize(NULL);
//Create an instance of the Active Desktop
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
//Insert code to call the IActiveDesktop methods
USES_CONVERSION;
LPCWSTR fname = A2W("c:\\ds\\2.bmp");
pActiveDesktop->SetWallpaper(fname, 0);
pActiveDesktop->ApplyChanges(AD_APPLY_ALL);
// Call the Release method
pActiveDesktop->Release();
return 0;
}