The codomain of $F$ should be Turing machines (or machines in some other particular model of computation) not the complexity class itself. You can't identify the machines that decide sets in a complexity class with the sets in the complexity class because it is not a one-one correspondence. Moreover a complexity class has various representations, you have to fix the representations of the sets in the complexity class (by fixing a model of computation) before discussing how to enumerate them.
Let $\tilde{C}$ be a representation of sets in the complexity class $C$, i.e. the sets decided by machines in $\tilde{C}$ belong to $C$ ($\tilde{C}$ doesn't need to be an r.e. set, e.g. $C = \mathsf{BPP}$ which we don't know any r.e. representation for, but it should be enumerable so we can consider it as a subset of $\mathbb{N}$). You want a function $F:\mathbb{N}\to \mathbb{N}$ s.t.
- for all $n\in\mathbb{N}$, $F(n) \in \tilde{C}$,
- for all $A \in C$, there is $n\in\mathbb{N}$ s.t. $L(F(n)) = A$,
- $F$ is computable.
So we have at least one representative for each set in $C$ and we can computably enumerate these representatives.
This is related to the question of being a syntactic complexity class. Most famous complexity classes turn out to be syntactic as is implied by Yuval's answer (it is open for other famous complexity classes like $\mathsf{BPP}$). If we have an efficient universal simulator for the complexity class then the class is syntactic. It is important to remember that we want machines that decide sets in the complexity class to decide them with reasonable resources.
ps: this is also known in literature as recursive representability, also sometimes referred to as recursive indexing of the complexity class (look also for computable in place of recursive).