I would remove in the following order:
1. CTI Route Points/JTAPI triggers
2. Telephony Groups/CTI Ports
3. Application
4. Script
5. Prompts
6. Queues
Remove the CTI Route Points/CTI ports from UCCX. It should take care of removing the items from CUCM. That depends on the versions you are using.
HTH.
Regards,
Bill