"Unholy Wars" (Pluto Press, available from Amazon) by John Cooley, an ABC News correspondent goes into exhaustive detail about the Afghan War. Yes, the CIA/Pakistan/Saudis/Egypt/China helped fund the Mugahaydeen, of whom Usama bin Laden was a leader. His training camp in Afghanistan, which the U.S. later bombed, was built to CIA specs, as he received major money and weapons from them.
The "unintended consequences" of the War were 1) the creation of the Taliban, 2) battle hardened well-trained terrorists spread out across the world, 3) the world market was flooded with much cheaper, vastly more potent heroin (as everyone was and still is, swapping drugs for guns).