If you want to use winmm.dll for example to play a sound (example copied from pinvoke.net) Goto http://www.pinvoke.net/ to get examples and definitions of all other APIs:
Public Declare Auto Function PlaySound Lib "winmm.dll" (ByVal pszSound As String, ByVal hmod As IntPtr, ByVal fdwSound As Integer) As Boolean
Public Declare Auto Function PlaySound Lib "winmm.dll" (ByVal pszSound As Byte(), ByVal hmod As IntPtr, ByVal fdwSound As SoundFlags) As Boolean
<Flags()> _
Public Enum SoundFlags As Integer
SND_SYNC = &H0
SND_ASYNC = &H1
SND_NODEFAULT = &H2
SND_MEMORY = &H4
SND_LOOP = &H8
SND_NOSTOP = &H10
SND_PURGE = &H40
SND_NOWAIT = &H2000
SND_ALIAS = &H10000
SND_FILENAME = &H20000
SND_RESOURCE = &H40004
End Enum
Public Shared Sub Play(ByVal strFileName As String)
PlaySound(strFileName, IntPtr.Zero, SoundFlags.SND_FILENAME Or SoundFlags.SND_ASYNC)
End Sub
Public Shared Sub Play(ByVal waveData As Byte())
'bad idea, see http://blogs.msdn.com/larryosterman/archive/2009/02/19/playsound-xxx-snd-memory-snd-async-is-almost-always-a-bad-idea.aspx
PlaySound(waveData, IntPtr.Zero, SoundFlags.SND_ASYNC Or SoundFlags.SND_MEMORY)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ip As UIntPtr = UIntPtr.Zero
Dim result As Boolean = PlaySound("C:\path\to\wav\file.wav", IntPtr.Zero, ip)
End Sub