If you're on vSphere 5.x, look at the GuestOperationsManager object. You can upload files, download files, manage directories and run programs.
If you're on vSphere < 5.x, look into the VIX API. It's an external DLL implementation. In vSphere 5, they rolled similar functionality into the core API with the GuestOperationsManager object.