Well, the most difficult part of this is designing the nanites. Considering that we are getting very good at building very complex and sophisticated computer hardware and software systems, but we haven't built many very complicated nanites yet, why not rely on what we know and push that as far as we can take it?
First let's assume that our nanites are nothing more than simple state machines that can do nothing but take a single instruction at a time and respond to that instruction. This relieves us of the very hard work of engineering complicated nanites to do very much on their own (and it's safer for us that way). When they have a signal, they are doing something with it, when they don't have a signal they are stuck waiting for the next instruction - only complex enough to do as we wish, but no more than that.
What this means is that we have several problems to solve in the way of controlling billions of nanites simultaneously and effectively.
We need a broadcasting system that can multiplex billions of signals simultaneously
We need a molecular backbone design for a radio receiver that can be permuted into billions of arbitrary configurations - doesn't matter which configuration as long as each configuration is listening to one of the slices of the broadcast signal
The states that can be achieved by processing the received signal need to be planned, but it could be as few as a handful of states - such as moving forward, actuating to some other direction, opening or closing some other actuator, etc, but basically all ON/OFF kinds of signals
Maybe the only thing that should be automated is when we are not sending a signal the nanites should "take a break" and find food, tend to whatever nanites do, etc*.
Knowing whether an instruction was received and locating each nanite (together this can be referred to as "tracking") can be accomplished as simply as how RFID tags work**. Similar to our molecular antennae, we could incorporate a kind of RFID like molecule which resonates at a configurable frequency (perhaps the antennae and the RFID-like device could be one and the same). Then listen for the echo of the sent signal and if it is heard, it can be assumed that the instruction was received. The same echo can be used to triangulate the nanite's position. If no echo is heard, then that nanite can be considered "lost" until a signature for it is found again.
Finally, we will need to have sophisticated software to coordinate nanite activity and the responsibility of doing so will rest solely upon that software. We are getting to a point where massive parallel processing is becoming affordable so that will not be a big issue. With deep learning techniques it will be possible to simply experiment with swarms of nanites in the many thousands or even billions, try to accomplish tasks with them and have software learn effective patterns of activity for quickly and or thoroughly accomplishing given tasks. This way we will have a set of tools that we know apply broadly to certain task and a system of organizing at a micro-management level.
*If we simply run them until they have no more chemical reserves they will break and perhaps die. Maybe this is what we want, maybe not, but running them out seems expensive and wasteful, however, perhaps there are other states ("developmental"/"off-duty", etc.) to discuss that are outside of the scope of this answer.
**For a more robust tracking system capable of ascertaining operational status of the nanite, it may be possible to create such a resonator which can shape shift slightly in order to modulate within the carrier signal and have internal signalling connect from the state processes inside the nanite back to the specific configurations of the resonator so as to "reflect" back some information about the nantites internal state. This will of course add complexity to the system and may or may not be useful considering that we are already somehow producing such devices in the billions and they are quite disposable.
Now as indicated in the above proposed input mechanism, we have a system for receiving instructions and we do not need internal storage since all activity is managed by an external resource.
As for how to execute those instructions, it would not be much different (and intentionally so) from how a cell already receives signals and performs basic functions. For example, Euglena species have already developed a system that causes the organism to swim toward a light signal - that could be modified minimally and utilized to design the entire navigation system for our device. The only things that we would have to focus specifically on is what modification is necessary to bridge our radio signal to the Euglena's optical sensory apparatus and how to transfer the incoming signal to that bridge - so it's basically logistical and hooking up a few circuits, not really any radical design decisions need to be made. The hard part is tracking down and controlling the genetics and other factors that produce these structures.
Other actuators could be controlled with a similar apparatus.