ARJ has an interesting review paper by Liu and Soper on the origin of retroviruses. Liu has written a number of papers on retroviruses, and this is in large part a culmination of his work.
The paper has a lot of interesting information:
The authors use these and other items to infer that retroviruses were originally part of the genome itself, and were later exogenized into free particles for infection. They also propose that retroviruses were used for horizontally transferring genetic material.
My personal hunch is that retroviruses have neither an origination outside the organism nor inside the originally-created DNA (at least not exclusively). I tend to go with Blanden and Steele's suggestion in Lamarck's Signature that they are instead used for somatic selection. That is, somatic cells do the real evolutionary work, and retroviruses package up that material and transport it - either back to the germ line or to other somatic cells.
Thus, retroviruses are essentially created by (or at least used by) somatic cells to move new genes back to the germ line for more efficient adaptation to new environments.
Anyway, it's a hunch.