The best way that I've found to clean a grater is to use a toothbrush.
The bristles are usually the right combination of stiffness and flexibility to not get caught in the blades of the grater (so you don't end up with grated toothbrush bristles), and they are fine and tightly packed, fitting into the tiny spaces and removing stuck on bits of ginger or cheese quite well.
I expect some vegetable brushes might also work well, if the bristles are thin and tightly packed.
For the shredding or slicing sides, a washcloth is usually a better choice, but for the grating sides, I haven't found anything as good as a toothbrush.