for this there is already an app ( Drop box ) , however you can start with this
Code:
vector<string>localfiles  // this holds list of local file.
vector <string>remotefiles // this list hold remote files.
then you can write file watched class this runs it it own thread to watch changed made to the remote and local file folder ( assuming that ) you have either some RPC / FTP way of communication this thee remote folder ,

so it simple terms if a file exist in remote folder and is not in the list of local folder then download it to local folder and then update the list of the local folder , same for the remote.

Of course your file watcher class would have incorporate Events for deletion , modify and Creation of files on the remote and local folders.