As per Wookieepedia:
At the end of the Clone Wars, Sith Lord Darth Vader turned off the Master control signal, deactivating most of the Separatist Droid Army. After this, battle droids were extremely rare.
The master control signal controlled all battle droids and warships of the CIS during the Clone Wars. Lord Vader used this signal to shut down the CIS's droid army and navy after he murdered the Separatist Council, thus paving the way for Palpatine's new Galactic Empire (source: The Complete Star Wars Encyclopedia).
I didn't find reference to exact sources yet, so this is suspect as of now.
Also, this section of Wookieepedia article on Separatist Droid Army explains what happened to some droids post-Episode 3.