You can ask Varnish to compile your VLC file to a temporary file. This is part of our script that loads a new configuration into our varnish servers:
tmpfile=$(mktemp)
trap 'rm -f $tmpfile' 0
varnishd -C -f /srv/web/fe/varnish/default.vcl > $tmpfile
echo
if [ ! -s $tmpfile ]; then
echo "ERROR: There are errors in the varnish configuration." >&2
exit 1
fi
This works because `varnishd -C` will not generate any output on `stdout` if there are errors in the VCL.