The current implementation (v3.0.0) for STM32C5 does not support USB-CDC. You should mention that in the notes column on https://github.com/stm32duino/Arduino_Core_STM32#generic-stm32c5-boards with big red marker. Because USB-CDC is the core component of Arduino which everybody expects to work out of the box.
#if defined(USE_HALV2_DRIVER)
#error "USB library is not yet compatible with HALv2 driver."
The current implementation (v3.0.0) for STM32C5 does not support USB-CDC. You should mention that in the notes column on https://github.com/stm32duino/Arduino_Core_STM32#generic-stm32c5-boards with big red marker. Because USB-CDC is the core component of Arduino which everybody expects to work out of the box.
Generic STM32C5 boards
STM32C552RE
Related line of code:
https://github.com/stm32duino/Arduino_Core_STM32/blob/main/libraries/USBDevice/inc/usbd_conf.h#L33