Not that far away actually(if you're simply using it for sex). We already have very realistic sex dolls. Just add an internal heating component that keeps it at roughly human body temperature. Roughly copy a human's muscular structure so that contractions and tensing happens in certain situations. You could simulate breathing with an artificial lung(like they use in hospitals). The software would basically be a complex version of a hentai flash game. If you're looking for some degree of sentience, its the difference between simulating animal behavior and human behavior(at least decades of research).
So, any other Computer software/hardware majors here planning on devoting their lives to sentient AI or GitS style 'robot body'?