There are some resources here that take you through the process of connecting a device to IoT Central and implementing the device code:
- https://learn.microsoft.com/en-us/azure/iot-central/core/tutorial-connect-device - this page has samples in multiple programming languages
- https://learn.microsoft.com/en-us/azure/iot-central/core/overview-iot-central-developer - this page is a conceptual overview of IoT Central device connectivity
Please follow up with any additional questions :)