In iPhone OS 2.x you can't access the music transferred to the phone via iTunes. You only have access to the data created by your own application.
The forthcoming version 3.0 does have this capability. Release notes include this
iPod Library Access
Several new classes and protocols have
been added to the Media Player
framework (MediaPlayer.framework) to
allow access to the user’s audio
library. You can use these classes to
perform the following tasks:
- Play audio items from the user’s library. This support lets you play
all audio types supported by the iPod
application.
- Construct queues of audio items to play back.
- Perform searches of the user’s audio library.
- Access the user’s playlists (including smart, on-the-go, and
genius playlists).
For more information about the classes
of the Media Player framework, see
Media Player Framework Reference.
(sorry,links may only be working for registered Apple developers).