Hello,
please have a look into the folder /Examples of your Build Environment - there you will find the example "DeviceIntegration". It shows how you can interact with the underlying system - in this case it is a hardbutton, a LED and the serial interface. You can use this application as a template for your development. This project can be build also by using Keil compiler.
As you already mentioned, there are two articles within our knowledge base that explains all necessary steps to make a proper device integration:
Integrating with the device
Device Class and Device Driver
Concerning I2C - let me refer to the corresponding examples that you will find within the STM32 Cube Firmware.
I hope this helps...
Best regards,
Manfred