Attachments are not stored in the database, they are embedded as BASE64 strings inside the InfoPath XML document you create.
They can be extracted (i.e. the BASE64 string can be decoded and the file stream can be infered from that).
Please note that IP adds a small header at the top of the decoded file stream.
Here you can find a couple of code snippets that can help you get started about attachments endoding: http://support.microsoft.com/kb/892730/en-us.
If you need to develop an application (not limited to Windows Applications) that is capable of extracting the attachments, you should load the IP XML and parse it, so that you can read and decode the attachment element.
In a windows applications reading data from a SharePoint library, this means you need to get access to the library.
You can use the SharePoint object model, but consider that it is limited to applications running on the SP server.
Otherwise, you can use the SharePoint web services from any location.
Also, you can write your own remote access layer, using the technology you prefer, and use the OM if you run your layer on the server.
HTH
Ciao