The simplest usage of VirtualAlloc is
LPVOID lpMem = VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);

size should be a multiple of the system page size for maximum efficiency (it's actually automatically rounded up) which can be obtained with GetSystemInfo, where it is the dwPageSize member of the SYSTEM_INFO structure.