The phrase is from the mind and pen of John Milton and appeared in his lyric poem L�Allegro, published in 1645.
Come, and trip it, as you go,
On the light fantastic toe.
We�ve lost the sense now, because to trip here doesn�t mean to catch one�s foot and stumble or fall, but rather to move lightly and nimbly, to dance. This was what the word meant when it appeared in the language in the fourteenth century. And fantastic (or fantastick, as Milton originally spelled it) has here a sense of something marked by extravagant fancy, perhaps capricious or impulsive.
http://www.worldwidewords.org/qa/qa-tri1.htm