Refer to STM32CubeIDE Input/Output on STM32 Nucleo Board in advance for basics.
In STM32CubeIDE, create a new STM32 project.
In Setup STM32 project window, select C++ for the Targeted Language.