I tried for long and found the following points are important
Always use the OSGEO4W-Shell to execute an osgeo-program, don't use cmd.exe directly. (The shell executes all batch files in %OSGEO4W_ROOT%/etc/ini where a lot of environment variables are set)
To start python with full qgis support, so you can run standalone python qgis apps, use the following environment settings:
SET QGIS_PREFIX_PATH=%OSGEO4W_ROOT:=/%/apps/qgis SET PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python SET PYTHONHOME=%OSGEO4W_ROOT%\apps\Python27 SET PATH=%PATH%;%OSGEO4W_ROOT%\apps\Python27\Scripts;%OSGEO4W_ROOT%\apps\qgis\bin
most of it you have already set, but mine is slightly different, as you can see. Plus the batch-files called by the osgeo4w-shell fill the %PATH% correctly. Try it, I hope, it helps.