So do you want to clean up all unassigned DNs, or only unassigned DNs that fit specific criteria?
One way to do this would be to Export (Bulk Administration > Import/Export > Export) the Directory Numbers (unassigned) table from the CUCM database. That would show you all of your unassigned DNs and all settings. Use Excel tools to isolate the list of DNs you want to delete. Hopefully it is only a few and you can delete them manually. But if it is a longer list AND you can isolate the DNs in groups, you can use Bulk Administration > Phones > Delete Phones > Delete Unassigned DN.
Give it a try with a small number and let us know if you have questions.