From Foreign Policy Journal:
After the Soviet Union invaded Afghanistan in December 1979, President Carter directed CIA to assist the Afghan mujahidin. CIA came to see that the indigenous Afghan opposition to the Soviets was less an organized movement than widespread opposition by villages and tribes.
Through Pakistan, CIA provided the mujahidin with money, weapons, medical supplies, and communications equipment. Initially the goal was to drain Soviet resources by keeping their forces bogged down. In 1985, CIA shifted from a plan of attrition to one that would help the rebels win. One of the pivotal moments came in September 1986, when the mujahidin used CIA-provided Stinger missiles to shoot down three Soviet Mi-24D helicopter gunships.
As part of this escalation of financial and materiel support, President Reagan issued new guidance that put CIA into more direct contact with rebel commanders, beginning an era of CIA interaction with tribal and local leaders that continues through the post-9/11 era.
The relationship between the U.S. and Osama bin Laden is unclear, but Bin Laden did fight the Soviets in Afghanistan in the 80’s – as the Mujahideen did.
An NBC report states this about CIA support for bin Laden:
As his unclassified CIA biography states, bin Laden left Saudi Arabia to fight the Soviet army in Afghanistan after Moscow’s invasion in 1979. By 1984, he was running a front organization known as Maktab al-Khidamar – the MAK – which funneled money, arms and fighters from the outside world into the Afghan war.
…the MAK was nurtured by Pakistan’s state security services, the Inter-Services Intelligence agency, or ISI, the CIA’s primary conduit for conducting the covert war against Moscow’s occupation.
The CIA, concerned about the factionalism of Afghanistan … found that Arab zealots who flocked to aid the Afghans were easier to “read” than the rivalry-ridden natives. While the Arab volunteers might well prove troublesome later, the agency reasoned, they at least were one-dimensionally anti-Soviet for now. So bin Laden, along with a small group of Islamic militants from Egypt, Pakistan, Lebanon, Syria and Palestinian refugee camps all over the Middle East, became the “reliable” partners of the CIA in its war against Moscow.