based on the provided information, it is not so easy to give you some helpful advice.
I think you are using the STM32F746 Discovery board. Have you seen the example DeviceIntegration from the folder /Examples within the Build Environment? It demonstrates how to access a LED from the GUI application. You can access your relays in same manner.
Furthermore, let me refer to the articles Integrating with the device and Device Class and Device Driver, both are part of our online documentation. They explain all basics about natvie code and the integration of external software APIs or hardware drivers.
Hope this helps...