You connect in the same way as you would with a local MySQL database, you just put different values in the connection string for the database location etc.

As to what the values should be, your host should be able to tell you that - or more likely, tell you that they do not allow remote connections to their databases because it is a big security risk.