There's a few ways to do that, some are easier than others.
First off, are you asking if you can arbitrarily execute VB code from a text file?
Visual Basic files require more structure than just 'Dim x as String', so if you wanted to use Visual Basic's compiler to do the work for you, you'd have to do some extra work, encase the code in a class and then a subroutine of that class.
If you want more control you could go the interpreter route, which is harder. Either find or create a lexer (text analysis) and parser (grammar analysis) for the language you want to use, then run through the parse graph one or more times to verify the semantics (in other words, what it means). Then use the parse graph (or whatever you turned it into with one of the other semantic passes) and interpret its code by evaluating the meaning of the individual symbols, such as what methods/assignments are mentioned in the file.