In general, there are three ways that I know of that you can do this. Each of them depend on your project (what language you're using, what you're trying to do etc.) and each of them have their pros and cons. One of them doesn't apply to your situation at all, but two of them can be used for any server side program.
1) Use MantisConnect from
http://www.futureware.biz/mantisconnect/ . This is written by one of the Mantis developers and is a webservice primarily, but just as important is that is comes with a great .NET component to use already. I can definitely say to try and use this first. No doubt.
You install the webservice code on the server and then you just connect like any other webservice. As I said, if you are able to use .NET components in your project, then you're already another step ahead.
We were able to write a little client-side application that would pull a particular issue from one database, present it to the user for tweaking, then report it into another database (different server, different project, different username) all in a few hours. It's brilliant!
2) Include the code directly. If you are doing a server side application and you want to be able to affect something in Mantis when doing something else, it's possible to include the Mantis code directly (basically 'absorbing' all of the API into your project) then call functions directly. Again, you would probably only do this if you didn't want to use the web service provided by step 1.
3) Simulate a user. Most languages will allow you to create POST commands to pages (and this was how I did a few things with Mantis before MantisConnect came along). Run the process as a user and record form action targets and the variables that are sent to them, then programmatically create POST / GET requests to the various pages with the information you want to use. It's a real pain to do, but there are libraries (I think libCurl does it) that can remove some of the pain.
So back to your case: use MantisConnect, for sure. Both VB and Perl should be able to consume the webservice easily enough.
Hope this helps and doesn't actually 'overinform'!
Lincoln.