Using the word 'Guy' to refer to a male human comes from Guy Fawkes (1570-1606), who was the most famous of a group of men who plotted to blow up the English parliament in 1605, as revenge for persecution of the Roman Catholics. The gunpowder plot failed, and Guy was hanged.

November 5 is still known as Guy Fawkes Day (or Bonfire Night), and an effigy called a guy is built by children to be burned that evening. Because of this, 'guy' later came to mean a foolish person (much in the same way as had 'dummy'), and, by natural progression, later to be an informal term for any male person.

Nowadays 'guys' can refer to a mixed group of males and females, or sometime a group of only females. A girl alone will almost never be referred to as a guy, although the traditional 'gal' is falling out of use, and I predict that it is only a matter of time before guy is a unisex term.