I tried to build using the CMakeList.txt and example-app.cpp you provided, and there isn’t any problem.
Here is what I did.
# Suppose you store libtorch in `C:\\Users\\Mike\\Libs\\torch\\libtorch-release`
# And the cmake project is stored in `C:\\Users\\Mike\\Libs\\torch\\example-app`
cd C:\Users\Mike\Libs\torch\example-app
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="C:\\Users\\Mike\\Libs\\torch\\libtorch-release" ..
cmake --build . --config Release
copy /Y C:\Users\Mike\Libs\torch\libtorch-release\lib\*.dll C:\Users\Mike\Libs\torch\example-app\build\Release\
cd Release
example-app.exe

For the debug configuration, you’ll only need to replace all occurences of Release into Debug.
You may also be interested in using Visual Studio for debugging, there may be some tricky points.

The VS project defaults to x64 and Debug. (Make sure it matches the version of the libraries)
You need to set the startup project to example-app.
You’ll need to copy the DLLs from LibTorch manually.