If you just want to get this into VB.NET pretty much as is then:
1) Create a new project.
2) Paste the code into a suitable place - a button click event in a windows app or Sub Main() of a console app.
3) Add references to the AutoCAD and AutoCAD/ObjectDBX type libraries.
4) Import the namespaces you'll be using (unless you want to fully qualify everything) - Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common.
5) Declare your undeclared variables.
6) Fix your unterminated If blocks and For loop.
Caution: Contents may be hot. Your mileage may vary. Results may not be typical.
No bytes were harmed during the production of this post.