The desktop file needs to be installed to:
/app/share/applications/<appid>.desktop
and the icon file to:
/app/share/icons/hicolor/<size>/apps/<appid>.<png|svg>
where your appid will be something like "com.example.myapp"
See http://docs.flatpak.org/en/latest/conventions.html
Note that the value for the "Exec" parameter in the desktop file should be the same as the "command" parameter in the flatpak manifest. The example given in the documentation is confusing because the name of the executable is the same as the appid, and if your executable is named differently you need to pick that instead. e.g. if your appid is "com.example.myapp" and your binary is just "myapp", you need "Exec=myapp" or even "Exec=/app/bin/myapp", not "Exec=com.example.myapp".
One last thing, if the desktop file appears to get installed, but nothing shows up in your program menu, it may be because your desktop environment needs you to log out and log back in again. See: https://ask.fedoraproject.org/en/question/128735/xfce-menu-doesnt-show-flatpak-apps/