I know USA developed & used them first but how did the USSR get their hands on it? Did they develop the technology independently or was it acquired through espionage?
In very general terms, the US developed the first weapons. Following the end of WWII, most of the German scientists who were involved in the German nuclear program were taken to Russia.
Based on declassified information, several scientists from the American program then handed over nuclear design information, greatly allowing the Soviets to accelerate their program.
It helped that the Soviets had excellent nuclear scientists and poured vast amounts of money.