It may be slightly different depending on which version of Visual Studio you are running, but in 2010, you open the project properties and click on "Settings" about halfway down the left panel. Enter a variable name, type and scope then enter an initial value. To load the value into an app variable you can do (let's assume a string setting named LastFile)
Dim lastfile As String = My.Settings.LastFile
To save that value back (to preserve the value between successive runs) just reverse the assignment.