You were partly right! House-elves were indeed part of the Battle of Hogwarts. But they were not led by Dobby as you have speculated but by Kreacher. Again, another instance of Rowling's ability to build up a picture of a character only for it to turn out entirely different. I wish I have that talent.