It is a bit of a tedious process but it works quite well.
From a reference genome you are interested in you can get a list of all uniprot ID's of all the proteins (a FASTA file). With a Python script you can retrieve a proper line from Uniprot's table output (that corresponds to given Uniprot ID) with "Gene ontology (cellular component)" column. From there you get GO (CC) ID's for each protein and you can sort them as you wish.
I used this method along IPC in my recent study. If you like I could provide more detail/ready scripts.
One thing to keep in mind though, GO assignments have varied uncertainty depending on the protein. You can read more about them here: