Microsoft under MIT licence has released the c++/cli code for the Windows 10 Calculator. This is available at https://github.com/Microsoft/calculator
The c++ source for vswhere may also be of interest as it has c++ code for parsing the command line, configuring a console etc. See https://github.com/Microsoft/vswhere