Here a quite old example with PSoC creator, that can be configured to any core based on the requirement. User guide explains the steps to be followed to make it work.
This code example uses the older boot loader SDK instead of DFU SDK. However rest of the concept would remain the same.
If you are specifically looking for DFU, CE216767 is the right code example to start with. Please can you post your errors and the project here (if possible) ?