Re:
For the BB, start with a good de-greaser and a rather hard toothbrush (I keep a couple of cheap toothbrushes just for that kind of stuff).
Be careful with the de-greaser though. Only use it on the outside of the shell, don't let it get anywhere near the seals on the axle itself.
Also be careful with the toothbrush itself. It's one hell of a way to get a splatter paintjob on the walls, sink, curtains, your clothes, the kitchen cabinet, etc etc.
If you get all the grime and rust off, a coating of grease or Vaseline will protect it for several more years.
As for getting into front and rear derailleurs (we usually write "mechs" here to make it easier), either paintbrushes or a small
test tube brush will do the trick.
If it's a really mucky one (which always seems to be the case when you buy a second-hand bike), I use de-greaser, then rinse it with plenty of water to get the last traces of de-greaser out.
Before the water has time to evaporate or cause corrosion, use enough WD-40 or chain oil to get rid of it and wipe the mech down with some paper towels or rags. Not exactly environmentally friendly, but my mechs are perfectly clean afterwards and will only require minimal effort to keep them that way even on the inside.