All that I know of Smaug is that he (she?) came out of nowhere to attack and conquer Erebor. Where exactly did he come from? In fact, what are the origins of dragons? Did Ilúvatar create them or did they come from somewhere else?
Their origin is not entirely known.
This source states:
Tolkien clearly wrote that dragons were bred by Morgoth but no one is sure how. Some belief that dragons are embodied Maiar, others believe they are simply beasts who were trained by Morgoth to speak and to think, still others suggest they are "sparks" of Morgoth himself, another theory is that dragons are crossbred from balrogs and other beasts
The dragons are known to be immortal, powerful, intelligent, but also greedy.
Another theory about their origin states:
The theory that Dragons were simply beasts perhaps physically enhanced by Morgoth, such as corrupted eagles is a very popular theory.
There are two types of dragons:
There is also another third type, Long-worms, without wings.
Cold-drakes were used to create Fire-drakes, but origin of the Cold-drakes is not known:
Tolkien gives no hint to the history of the cold-drakes after this time period. They may have, however, been animals created by Yavanna (and therefore the first dragons) that were then used by Morgoth to breed the much stronger and more wicked Uruloki.
Smaug being one of the fire-drakes:
Tolkien confirmed in a letter that Smaug was the last of his kind (The last of the great Fire Drakes of Middle Earth...
By this statement we can conclude that Smaug was bred by Morgoth.
But, there is something else (from Fire-drakes):
All the famous dragons throughout the ages were fire-drakes (aka Ancalagon, Glaurung, Smaug, etc.) although only some of them fought for Morgoth
So not all of them fought for him, but all were enhanced by him (it seems).
Further explanation to Smaugs appearance in the Third Age, Fire-drakes:
All Fire-drakes were thought to have been killed before the Second Age, but Smaug the Golden survived and in the Third Age descended on Erebor in TA 2770 and sacked the Lonely Mountain, at the time held by Thrór, the Dwarven King under the Mountain.
Dragons can't be corrupted Eagles because the first one was wingless.
If they were Maiar we would surely expect to see them mentioned in the Valaquenta, but yet they're not.
We do, in actual fact, have one recorded description of Morgoth "creating" a being in the Silmarillion: the description of the origin of the wolf Carcharoth in Of Beren and Luthien:
he chose one from among the whelps of the race of Draugluin; and he fed him with his own hand upon living flesh, and put his power upon him. Swiftly the wolf grew, until he could creep into no den, but lay huge and hungry before the feet of Morgoth. There the fire and anguish of hell entered into him, and he became filled with a devouring spirit, tormented, terrible, and strong
Furthermore, this wasn't some simple dumb beast:
Now Carcharoth espied them from afar, and he was filled with doubt; for news had long been brought to Angband that Draugluin was dead. Therefore when they approached he denied them entry, and bade them stand
(My emphasis in both cases).
It doesn't, and shouldn't, boggle the mind too much to imagine Glaurung having a similar origin, though from a snake or lizard rather than a wolf pup.
As for what kind of spirit this could be, an easy answer is provided by the Silmarillion, chapter 2 (Of Aule and Yavanna):
Behold! When the Children awake, then the thought of Yavanna will awake also, and it will summon spirits from afar, and they will go among the kelvar and the olvar, and some will dwell therein, and be held in reverence, and their just anger shall be feared.
There's absolutely nothing in Tolkien that dictates that the Ainur (Valar and Maiar) were the only spirits in Middle-earth, and this third class of spirit provides an answer for a lot of other beings too.
Update - 13th March 2015
In Christopher Tolkien's commentary on paragraph 307 of the Grey Annals (History of Middle-earth 11) he notes the following (with my emphasis):
...the manuscript reads 'the fell spirit of Morgoth, who made him' (cf.IV.128). My father underlined the last three words in pencil, and faintly and barely legibly at the foot of the page he noted : 'Glaurung must be a demon [??contained in worm form].'
This is the sole statement I am aware of that establishes a definite origin for dragons (aside from works such as the Lost Tales where they are artificial constructs) and it supports my supposition that dragons may have had a similar origin to the wolf Carcharoth.
In the Silmarillion, Morgoth created the first dragon Glaurung. The first of the Urulóki (the Fire-drakes of Angband), he was much more powerful than what Smaug is shown to be. He could speak and understand tongues and control the mind of men. Glaurung is supposed to have sired the rest of his kin.
Though Glaurung is known as the Father of the Dragons, Ancalagon the Black was a winged dragon whereas Glaurung was wingless. According to wikipedia, Ancalagon was created by Sauron in the first age, so he is presumably not descended directly from Glaurung.
As to how Glaurung was created, there are many theories, one saying that they are corrupted eagles, one saying that they are Maiar in corporeal form. For a detailed discussion of this, look at this excellent article.