I am using the following .htaccess file to remove the index.php part of the url.
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect hidden files from being viewed
Order Deny,Allow
Deny From All
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !favicon.ico$
RewriteRule .* index.php/$0 [PT]
Otherwise I can recommend the Kohana framework as a reference (they also have a fairly nice url parser and controller system)