There are two relevant built-in marks holding the positions of the first
and last characters of the last visual selection in the current buffer.
In order to move the cursor to these marks, use the commands `<
and `>, respectively (see :help `> and :help `<).
if you just want to surround a visual selection there has already work been done, namely by tim pope, who wrote this plugin called surround. It surrounds words or visual selection with delimiters of your liking.
select your visual selection, say i like vim hit S) to get (i like vim) or S( to get ( i like vim ), to change this to [i like vim] type cs] (change surrounding) and to delete ds] to get i like vim at last.