There's no exact way to to this in user mode. And Windows mostly tries to prevent apps from hogging up all the system resources. But you could probably isolate the majority of other processes to another core/processor such that your code can run on a core mostly dedicated to it.
Start by looking at this code here on MSDN on enumerating processes. Except your enumeration code will specify PROCESS_SET_INFORMATION as the flag to OpenProcess. You'll likely need your code running with admin privs to do this for processes not running as your NT creds. For each process handle obtained, call SetProcessAffinityMask to set the process to run on all cores but one. Then set your your process to run another on the reserved core you culled out from all the other process handles.
This won't handle other processes from starting up and getting load balanced to the core you are trying to run your code on.
Your mileage may vary. If this is just for testing or for machines dedicated to your code, then it will probably be fine. If this is for a commercial app meant to run alongside all other apps, customers will be terribly disappointed to see all their other apps and services tank when they run your code. Tread carefully.