The droid armies were financed by anyone and everyone, very much like a militia force. Each member of the CIS built, funded, and contributed their droids to the army, where in they were under the command of General Grievous.
The Separatist Droid Army was a massive, eclectic mix of droids, organic soldiers, vehicles and aircraft drawn from the various systems and corporate organizations that had declared for the Confederacy, including the Trade Federation Droid Army, the Techno Union Droid Army, the Commerce Guild Punitive Security Forces, the IGBC Collections and Security Division, and the Corporate Alliance Policy Administration Directorate.
Separatist Droid Army
This question covers cost of droids in greater depth, but in short:
If you consult the Role Playing Game books by George Lucas as single B1 battle droid cost 1,800 credit so you could say the army is expensive but easy to repair.
So if memory is correct I think B2 battle droid were 3,000 credits. The one that cost the most was the droideka they were 21,000 credits so they were less on battlefield only for protection or used against jedi.
Titan84
The size of the army in Legends is the source of much speculation. Especially since it is hard to determine what is propaganda (in-universe) as opposed to fact. The CIS had millions of factories on thousands of worlds churning out droids for 5-6 years. The Battle of Geonosis featured about 1.2 million droids, and it is said by the end of the war, there were quintillions of droids in service. Remember that the CIS's strategy was to win by sheer force of numbers, so it is not unreasonable for them to have had trillions or quintillions of droids across the million or so contested worlds.