Here I am using Linq in SharePoint 2010 to Query SPList data.
Step-1: Use SPMetal.exe to generate DataContext Class for SharePoint
After executing above command your DataContext Class will be generated as shown below...
Step-2: Now Create New Project in Visual Studio -> Create Console Application -> In the Solution Explorer Right click and Add Existing Item -> Add generated class into your project
Step-3: Add Name Space in your .cs file (I used using testLnq; as given above) and use your DataContext class to query SPList data...