This doesn't have anything to do with TFS. This is just a Visual Studio project like any other.
What exactly do you mean by "connect to it from my code"? .NET code doesn't directly interact with a database project, but can form a data access layer to interact with a database.
If you right-click on the database project in Visual Studio, there is an option to deploy (or perhaps publish, depending on the Visual Studio version). You can deploy the database project to a live database and then your .NET code can interact with that database.
This can be multiple databases. For example, your automated builds can deploy to a shared database for everyone to use, and individual developers can deploy to their local workstations for development and debugging purposes.