If you run your .vbs in the console, i.e. using CScript.exe, the you can redirect the output using ">":
CScript example.vbs //NoLogo > output.txt
And inside your .vbs use WScript.StdOut object with .Write or .WriteLine method. For example:
' example.vbs
Main
Sub Main()
Dim result
result = 1 / Cos(25)
WScript.StdOut.Write result
End Sub
But if you run your script with WScript.exe...
WScript example2.vbs
...you'll need to write your output to file using FileSystemObject.
' example2.vbs
Main
Sub Main()
Dim result, fso, fs
result = 1 / Cos(25)
Set fso = CreateObject("Scripting.FileSystemObject")
Set fs = fso.CreateTextFile("output.txt", True)
fs.Write result
fs.Close
End Sub