File associations are stored in the Registry for each system. If you're using a paid-for version of Visual Studio then you can create a Setup project to build an MSI installer for your application and use that to create the file association. If you want to use ClickOnce deployment simply copy the files across to the destination then you're either going to have to have the user create a association manually in Windows or else edit the Registry yourself in code.
Once the file association exists then double-clicking a file with that extension will open your application and pass the file path as a commandline argument. It's up to you to use that file path in whatever way is appropriate, e.g. open the file and display its contents. You can do that using e.CommandLine property in the application's Startup event handler or else the Environment.GetCommandLineArgs method anywhere.
You may already be aware but just note that creating the file association simply creates a default action for files with that extension. It doesn't prevent the user opening that file in another application though. Visual Studio is a prime example. The SLN and VBPROJ files that store solution and project information are just text files. If you double-click one they will open in VS, but that doesn't mean you can't still open them in Notepad and view the contents. If you genuinely want to protect the contents of a file then you'll need to encrypt it.