The client makes an http request to your domain and gets directed to the varnish server, which is mostly transparent to the end user. The varnish server checks its cache and if it has the file it serves it. If not it asks the apache server for the file. The apache server knows nothing about the end user unless you tell varnish to tell apache about it. You can't pass the client's ip straight through because apache can't reply directly back to the client, the client will drop the packets, so you set up a custom field that has the client's ip in it. Now all you have to do is tell Apache to log that field instead of the IP and you're in business.
The link I mentioned above explains how to do this, but unless you're will to spend some time learning how to configure varnish there's not much point to running it.