Use
Double.TryParse method.

Code:
' this will cast string to double:
Dim str As String = "3.14"
Dim d As Double = 0

If Not Double.TryParse(str, d) Then
   ' The string is in invalid format
End If