I know there has been alot of theories regarding the Sharingans origins. First off I'll get this out the way. I don't know if the Sharingan is developed from the Byakugan or if Madara is the first Sharingan user. The manga said Madara was the first to unlock the MS not the first to possess the Sharingan. Whether either of these are true doesn't matter.

What I believe is that the Sharingan is actually derived from the nine tail fox. I believe the first Sharingan users (whether it's Madara or not) mother was a Jinchuuriki. I believe the Jinchuuriki gave birth and some of the nine tail foxs chakra mingled with the child. I also believe the outcome of this was the Sharingan. The woman could have been a Hyuuga, but it doesn't really matter. This would explain why the eyes are cursed and why they have such a strong connection with the fox.