I don't know the origin, but in one form or another it goes back at least to the Rambam: he began each section of his major works with the phrase בשם ה' א-ל עולם (though this has been omitted in most later printings).
There are halachic opinions that the letter ה has kedushah when it is used to represent Hashem's name (since it is one of its letters), and that therefore a paper containing such a reference must not be treated disrespectfully. (For this reason, some books, magazines, etc., use 'ד instead of 'ה when referring to Hashem.) Using בס"ד, then, avoids any such issues.
On the other hand, ב"ה has an advantage in that it is not only invoking Hashem's help (when expanded to 'בעזרת ה) but also blessing Him (when expanded to 'ברוך ה), so some people prefer that instead.