This seems very similar to this question is it possible store images and documents in database.com.
But focussing in on attachments, an Attachment object has a
ParentId field that is the Id of the object (e.g. Contact) that it is attached to. In normal Salesforce there is standard user interface to upload attachments for an object; if that is not available in Database.com then you will have to do that programatically.
In normal Salesforce, an Attachment can be viewed (assuming the request includes authentication information) using a URL of this form "/servlet/servlet.FileDownload?file=00Pi0000005EOWB" where the ID is the ID of the Attachment.
The Attachment object can't be customised, but does have
Description fields available (and can be used for various content types such as images and documents with the type recorded in the
I do not understand how your Salesforce Visualforce login page will allow Database.com access. Or perhaps you are looking to store the images/documents in Database.com and relate them to objects in Salesforce.com. So if either of those are the central point of your question, perhaps you can clarify the question and then hopefully someone else can answer.