Wooho I finally figured this one out.
It’s a bug in Windows 7 and likely in Windows Server 2008 (possibly 64bit versions only). It surfaces when you disable Application Experience service.
Re-enabling this service has fixed this problem for me.
You can’t imagine how happy I am, this was making programming so frustrating as it’s not just messing with VC, but any compiler and to top it off it’s quite random.
A bit more info here as to why it’s causing a problem.
List of other SO questions which seem to be related: