From Wikipedia:
Music notation systems have used letters of the alphabet for centuries. The 6th century philosopher Boethius is known to have used the first fifteen letters of the alphabet to signify the notes of the two-octave range that was in use at the time.
Following this, the system of repeating letters A-G in each octave was introduced. The remaining five notes of the chromatic scale (the black keys on a piano keyboard) were added gradually; the first being B, which was flattened in certain modes to avoid the dissonant tritone interval. This change was not always shown in notation, but when written, B♭ (B-flat) was written as a Latin, round "b", and B♮ (B-natural) a Gothic or "hard-edged" b. These evolved into the modern flat and natural symbols respectively. The sharp symbol arose from a barred b, called the "cancelled b". In parts of Europe, including Germany, Poland, Hungary and Russia, the natural symbol transformed into the letter H (possibly for hart, German for hard).