The barrier was formed over 500,000 years ago by the Q Continuum as a means of containing the omnipotent being, 0, in the void between the Milky Way Galaxy and the Andromeda Galaxy, and thus protecting the Milky Way from his evil influence. (TNG novel: The Q Continuum: Q-Strike).
Following a battle with Trelane in 2370, Q was sent back to the initial creation of the barrier, and was turned into a non-corporeal entity by Trelane. Being in a deeply disorientated state, Q became trapped inside the barrier until the 23rd century. (TNG novel: Q-Squared).
In December 2069, the Earth vessel SS Valiant was swept into the barrier after encountering a magnetic storm. Contact with the barrier leaves six crewmembers dead and chief engineer, Geirrod Agnarsson, was transformed into a psionic super-human after a disorientated Q possessed him. After Agnarsson killed several security guards, Captain Carlos Tarasco had no choice but to order the destruction of his own ship, after all crew had left via escape pods. Unfortunately, only 12 crew managed to survive the explosion and they soon began to develop psionic abilities due to their close proximity to the barrier. (TNG novels: The Valiant and Q-Squared; and TOS episode: "Where No Man Has Gone Before").
In 2265, Admiral Saylor of Starbase 33 ordered the USS Enterprise to explore the edge of the galaxy, and even probe beyond the barrier. However, upon the Enterprise's arrival at the barrier, 9 crewmembers were killed and two other began to change into super-human beings, as Q once again tried to reach out to their minds. (TOS episode: "Where No Man Has Gone Before" and TNG novel: Q-Squared).
When a party of Kelvans took control of the Enterprise in 2268 in order to begin the journey back to Kelva, they forced the Enterprise crew to take the ship out of the galaxy. The Enterprise was able to successfully cross the barrier this time, thanks to modifications the Kelvans forced the Enterprise crew to make.(TOS episode: "By Any Other Name")
Sometime after the Borg had attacked El-Auria, Delcara acquired a small one-person ship and used it to cross the barrier. Delcara managed to locate the Planet Killer that had been left by the Preservers after their war with the Borg.
By the mid 24th century technology had improved to the point that ships stood a much better chance of surviving an encounter with the barrier, but even then there was little interest in exploring space beyond the barrier as it would take centuries to cross the void between the Milky Way and Andromeda galaxies. (TNG novel: Vendetta)