Used to do stuff like this as an apprentice. You have to heat whatever it is up until it's bright red (damm hot) then put it in a large container of oil. You really need a large one as a small amount of oil will get very hot and possibly catch fire !
You can get chemical blacking which is used on gun barrels. I haven't used this myself but would save you having to heat stuff up a lot. There is always a risk that heating could cause things like axles etc to bend or crack.
I expect someone on here has found a good way to do it.