Directory remapping is your answer. See Panel > Domains > Remap sub-directory. I was going to tell you that earlier, but firefox died on me, and I forgot about your post by the time I got back to the forum.
Actually this won't work. Regardless of how you access the user space, Dreamhost sets up the new new user directory at /home/newuser. Your domain is at /home/firstuser/domain.com/. There's also premission issues, newuser can't write to firtuser's area - there's read access, but no write. There's ways around this, directory remapping being one of them, but building your own FTP client won't do it.
On a side note, is building your own ftp program really a simple solution?