Was having this issue on latest version of UE (5.3.2) and Visual Studio Community 22 (17.8.0).
Issue was persistent no matter the versions of MSVC build tools installed. Eventually discovered that this for me was an issue in the app data.
Fix:
- Open visual studio installer, uninstall all unnecessary versions of MSVC under individual components.
- Install the necessary version of MSVC, refer to UE documentation for what this is but for me I ended up with just MSVC x64 build tools latest and v14.22-17.4
- (Here is a secret sauce that I wish I knew 2 hours ago), delete: %appdata%/roaming/unrealEngine/UnrealBuildTool/BuildConfiguration.xml
After deleting the xml (which will be automatically recreated by UE next time you open it), I was finally again able to create C++ projects.